Skip to content

Conversation

eymar
Copy link
Member

@eymar eymar commented Aug 7, 2025

Use Web Cache API for all resources

The Cache is reset on every app launch (page refresh).
The initial idea was to reset the Cache only when a new session starts, but we risk to have an outdated resources state (it can be incompatible with the app logic expectations and lead to crashes).

Fixes https://youtrack.jetbrains.com/issue/CMP-7996

Testing

This should be tested by QA

Release Notes

Fixes - Resources

  • Use Web Cache API for all resources to avoid repeated and redundant HTTP requests

@eymar eymar requested a review from terrakok August 7, 2025 13:03
@eymar eymar changed the title Ok/use web caches for string resources response Use Web Cache API for string resources caching Aug 7, 2025
@eymar
Copy link
Member Author

eymar commented Aug 7, 2025

cc: @terrakok when you are back :)

I'd like to include this into 1.10

Copy link
Member

@terrakok terrakok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the new ResourceReader's method I'd like to have next:

  • CvrWebCache - implementation of the web cache specifically for CVR files
  • in the web ResourceReader.readPart function implementation to add a logic: if the path is ended with .cvr then to use cached values

WDYT?

import org.w3c.workers.Cache

/**
* We use [Cache] and [org.w3c.dom.WindowSessionStorage] APIs to cache the successful strings.cvr responses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use it specifically for Strings.CVR then let's rename it to StringsWebCache. Otherwise, we mustn't mention cvr in the kdoc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's called ResourceWebCache. It's applied for all requests which go through web resource reader (in readAsBlob).

@terrakok
Copy link
Member

Might be worth to use it for all resource types

@ApoloApps
Copy link

Hi any progress? Would be nice to have for all resource types btw!

@eymar eymar force-pushed the ok/use_web_caches_for_string_resources_response branch from 7086016 to c2dbca8 Compare October 15, 2025 12:22
@eymar eymar changed the title Use Web Cache API for string resources caching Use Web Cache API for extra layer of resources caching Oct 15, 2025
@eymar
Copy link
Member Author

eymar commented Oct 15, 2025

Ready for a new review.

@eymar eymar requested a review from terrakok October 15, 2025 14:36
@eymar eymar merged commit ff72d5f into master Oct 20, 2025
1 check passed
@eymar eymar deleted the ok/use_web_caches_for_string_resources_response branch October 20, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants